Addtional Question 1 Visualization


In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint
from IPython.html.widgets import interact, interactive, fixed
from IPython.display import YouTubeVideo


:0: FutureWarning: IPython widgets are experimental and may change in the future.

In [2]:
from plotting_function import plotter,static_plot,com_plot,static_plot_com

Reading data back from file:


In [3]:
f = open('additional_1_data.npz','r')
r = np.load('additional_1_data.npz')
sol_add1 = r['arr_0']
ic_add1 = r['arr_1']
f.close()

As with the base question, I can use interact to view the positions of the bodies in my system:


In [4]:
interact(plotter,ic=fixed(ic_add1),sol=fixed(sol_add1),n=(0,len(np.linspace(0,1.2,100))-1,1));


Animation showing behavior:


In [5]:
YouTubeVideo('5cGNGarXhiE',width=600,height=600)


Out[5]:

Static plots:


In [6]:
specific_t = [0,25,30,35,40,45,50,55,60,70,80,90,100]

plt.figure(figsize=(20,30))
i = 1
for n in specific_t:
    if i > 13:
        break
    else:
        plt.subplot(5,3,i)
        static_plot(ic_add1,sol_add1,n)
    i += 1
plt.tight_layout()


Interactive plot around the center of mass between the two galaxies:


In [7]:
interact(com_plot,ic=fixed(ic_add1),sol=fixed(sol_add1),M=fixed(1e11),S=fixed((1e11)/3),n=(0,len(np.linspace(0,1.2,100))-1,1));


Animation around center of mass:


In [8]:
YouTubeVideo('Ecc-hctnXdc',width=600,height=600)


Out[8]:

Static plots around center of mass:


In [9]:
specific_t = [0,25,30,35,40,45,50,55,60,70,80,90,100]

plt.figure(figsize=(20,30))
i = 1
for n in specific_t:
    if i > 13:
        break
    else:
        plt.subplot(5,3,i)
        static_plot_com(ic_add1,sol_add1,1e11,(1e11)/3,n)
    i += 1
plt.tight_layout()


As can be seen, since the mass of $M$ is three time the mass of $S$, the stars are not as dramatically affected by $S$


In [ ]: